#include "Solution.h"
#include <iostream>

int main()
{
	string line;
	Solution s;
	while(getline(cin,line))
	{
		if(line == "")
			break;
		vector<string> ips = s.restoreIpAddresses(line);
		if(ips.empty())
		{
			cout<<"NULL"<<endl;
		}
		else
		{
			for(size_t i=0;i<ips.size();i++)
			{
				cout<<ips[i]<<endl;
			}
		}
	}
}